/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package da523blab3;

/**
 *
 * @author Macfeast
 */
public class DB implements DBInterface {
    private boolean userIsConnected;
    private String[] name = {"Test1", "Test2", "Test3", "Test4", "Test5"};
    public @Override boolean connect(String address, String userName, String password){
        if (address == "Test Address" && userName == "Test Username" && password == "Test Password"){
            userIsConnected = true;
            return true;
        }
        return false;
    }
    public @Override void disconnect(){
        userIsConnected = false;
    }
    public @Override boolean isConnected(){
        return userIsConnected;
    } 
    public @Override String getName(int id){
        return name[id];
    }

    /**
     * @param userIsConnected the userIsConnected to set
     */
    public void setUserIsConnected(boolean userIsConnected) {
        this.userIsConnected = userIsConnected;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name, int id) {
        this.name[id] = name;
    }
}